<template>
	<view class="order_content">
		<view class="tab_type">
			<view class="tabs" :class="{selected: type == 1}" @tap="changeType(1)">招聘</view>
			<view class="tabs" :class="{selected: type == 2}" @tap="changeType(2)">求职</view>
			<view class="tabs " :class="{selected: type == 3}" @tap="changeType(3)">房源</view>
		</view>
		<view class="order_list" v-for="(item,index) in list" :key="index">
			<view class="order_num">订单号：{{item.payId}}</view>
			<view class="order_b">
				<view class="order_money">￥{{item.money/100}}</view>
				<view class="order_time">{{item.addtime}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: 1,
				list: []
			}
		},
		onLoad() {
			this.getPayList()
		},
		methods: {
			changeType(type){
				let that = this
				that.type = type
				that.getPayList()
			},
			getPayList(){
				let that = this
				that.$api.request('/api/pay/payOrderList','',{
					userId: uni.getStorageSync("userId"),
					contentType: that.type,
					status: 1
				}, failres => {
					
				}).then(res => {
					console.log(res)
					that.list = res.rows
				})
			}
		}
	}
</script>

<style lang="scss">
	.order_content{
		width: 100%;
		background: #F5F5F5;
		min-height: 100vh;
		.order_list{
			width: 95%;
			margin: 0 auto;
			border-bottom: 1rpx solid #efefef;
			.order_num{
				font-size: 28rpx;
				color: #222222;
				margin-top: 20rpx;
			}
			.order_b{
				margin-top: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-size: 28rpx;
				color: #CCCCCC;
				margin-bottom: 20rpx;
				.order_money{
					color: #007AFF;
				}
			}
		}
		.tab_type{
			padding: 30rpx;
			height: 60rpx;
			display: flex;
			align-items: center;
			.tabs{
				font-size: 32rpx;
				display: inline-block;
				background: #EFEFEF;
				color: #979797;
				padding: 10rpx 20rpx;
				border-radius: 20rpx;
				margin-right: 20rpx;
				margin-bottom: 20rpx;
			}
			.selected{
				background: #56CC93;
				color: #FFFFFF;
			}
		}
	}
</style>
